<style>
	.table_user{border:none !important}
	.table_user tr{height:35px !important;padding:0px !important;}
	.table_user tr td{border:none !important;height:35px !important;line-height: 35px !important;padding:0px !important;}
</style>
<table class="table table_user" >
	<tbody>
		<tr >
			<td width="15%" rowspan="2" style="padding-bottom:15px !important;height:45px;line-height: 45px;" class="tdleft">
				<if condition="$user['img']">
					<img style="border-radius:50%;width:60px;height:60px;" src="{$user['img']}"></img>
				<else/>
					<img src="__PUBLIC__/img/avatar_default.png" style="border-radius:50%;width:60px;height:60px;" />
				</if>
			</td>
			<td ><span style="font-size:19px;">{$user.full_name}</span> &nbsp;&nbsp;
				<if condition="$user['sex'] eq 1">
					<img style="margin-top:-3px;" title="男" src="__PUBLIC__/img/nan.png"/>
				<elseif condition="$user['sex'] eq 2"/>
					<img style="margin-top:-3px;" title="女" src="__PUBLIC__/img/nv.png"/>
				</if>
			</td>
			<td></td>
			<td></td>
		</tr>
		<tr >
			<td style="padding-bottom:15px !important;height:45px;line-height: 45px;">
				<span style="color:#999;">账号状态:</span>&nbsp;&nbsp;
				<if condition="$user['status'] eq 1">已激活
				<elseif condition="$user['status'] eq 2"/>已停用
				<elseif condition="$user['status'] eq 3"/>未激活
				</if>
			</td>
			<td></td>
			<td></td>
		</tr>
		<tr style="border-top:1px solid #d8e3ef;">
			<td colspan="4">{:L('BASIC_INFO')}</td>
		</tr>
		<tr>
			<td width="15%" class="tdleft">{:L('USERNAME')}</td>
			<td width="35%">
				{$user.full_name}
				<volist name="categoryList" id="temp">
					<if condition="$temp.category_id eq $user['category_id']">（{$temp.name}）</if>
				</volist>
			</td>
			<td width="15%" class="tdleft">编号</td>
			<td width="35%">{$user['number']}</td>
		</tr>
		<tr>
			<td class="tdleft">{:L('DEPARTMENT')}</td>
			<td>{$user.role.department_name}</td>
			<td class="tdleft">{:L('POSITION')}</td>
			<td>{$user.role.role_name}</td>
		</tr>
		<tr>
			<td class="tdleft">{:L('TELPHONE')}</td>
			<td><if condition="C('ismobile') eq 1"><a href="tel:{$user.telephone}">{$user.telephone}</a><else />{$user.telephone}</if></td>
			<td class="tdleft">{:L('EMAIL')}</td>
			<td>{$user.email}</td>
		</tr>
		<tr>
			<td class="tdleft" style="padding-bottom:15px;">QQ</td>
			<td>{$user.qq}</td>
			<td colspan="2"></td>
		</tr>
		<tr style="border-top:1px solid #d8e3ef;padding-top:5px;margin-top:10px;">
			<th colspan="4">{:L('MESSAGE')}</th> 
		</tr>
		<tr>
			<td class="tdleft">{:L('CONTENT')}</td>
			<td colspan="3">
				<textarea rows="3" class="form-control" id="dialog_content" name="content"></textarea>
			</td>
		</tr>
		<tr >
			<td>&nbsp;</td>
			<td colspan="3" style="height:45px;line-height: 45px;padding:7px !important;">
				<input class="btn btn-primary pull-right" style="background-color:#fff;border:1px solid #ccc;color:#999" id="close" name="close" type="button" value="{:L('CANCEL')}"/>&nbsp; &nbsp;
				<input class="btn btn-primary pull-right" style="margin-right:10px;" id="send" name="send" type="button" value="{:L('SEND')}"/>&nbsp; &nbsp;
				<span id="result"></span>
			</td>
		</tr>
	</tbody>
</table>
<script type="text/javascript">
	$('tbody').keydown(function(event){
		if(event.keyCode == "13"){
			$('#send').click();
		}
	});

	$('#close').click(
		function(){
			$('#dialog-role-info').dialog('close');
		}
	);
	$('#send').click(
		function(){			
			to_role_id = {$user.role.role_id};
			content = $('#dialog_content').val();
			if(content!=''){
				$("#result").html('<span style="color:red">{:L("SENDING_MESSAGE")}</span>');
				$("#send").attr('disabled', "disabled");
				$.post('{:U("message/ajaxsend")}',
					{
						to_role_id:to_role_id,
						content:content
					},
					function(data){
						if(data.status == 1){
							$("#result").html('<span style="color:green">{:L("SEND_SUCCESS")}</span>');
							$("#send").attr('disabled', false);
							$("#dialog_content").val("");
						} else if(data.status == 0) {
							$("#result").html('<span style="color:red">{:L("SEND_FAILED")}</span>');
						}
					},
				'json');
			} else {
				$("#result").html('<span style="color:red">{:L("NEED_CONTENT")}</span>');
			}
		}
	);
</script>